class LatestRawDataBean {
  Latest latest;
  int offline;

  LatestRawDataBean({this.latest, this.offline});

  LatestRawDataBean.fromJson(Map<String, dynamic> json) {
    offline = json['offline'];
    if (json['offline'] == 0) {
      latest = Latest.fromJson(json['latest']);
    }
  }
}

class Latest {
  Alarm alarm;
  String createTime;
  String id;
  Parameters parameters;
  State state;

  Latest({this.alarm, this.createTime, this.id, this.parameters, this.state});

  Latest.fromJson(Map<String, dynamic> json) {
    createTime = json['createTime'];
    id = json['id'];

    if (json['alarm'] != null) alarm = Alarm.fromJson(json['alarm']);

    if (json['parameters'] != null)
      parameters = Parameters.fromJson(json['parameters']);

    if (json['state'] != null) state = State.fromJson(json['state']);
  }
}

class Alarm {
  String downAlarm;
  String electromobile;
  String kaceng;
  String kunren;
  String power;
  String ppp;
  String runDoor;
  String slantFb;
  String slantLr;
  String speeding;
  String stpDoorUnclose;
  String stpDoorUnopen;
  String stpReapet;
  String upAlarm;
  String yn;

  Alarm(
      {this.downAlarm,
      this.electromobile,
      this.kaceng,
      this.kunren,
      this.power,
      this.ppp,
      this.runDoor,
      this.slantFb,
      this.slantLr,
      this.speeding,
      this.stpDoorUnclose,
      this.stpDoorUnopen,
      this.stpReapet,
      this.upAlarm,
      this.yn});

  Alarm.fromJson(Map<String, dynamic> json) {
    downAlarm = json['downAlarm'];
    electromobile = json['electromobile'];
    kaceng = json['kaceng'];
    kunren = json['kunren'];
    power = json['power'];
    ppp = json['ppp'];
    runDoor = json['runDoor'];
    slantFb = json['slantFb'];
    slantLr = json['slantLr'];
    speeding = json['speeding'];
    stpDoorUnclose = json['stpDoorUnclose'];
    stpDoorUnopen = json['stpDoorUnopen'];
    stpReapet = json['stpReapet'];
    upAlarm = json['upAlarm'];
    yn = json['yn'];
  }
}

class Parameters {
  String appkey;
  String id;

  Parameters({this.appkey, this.id});

  Parameters.fromJson(Map<String, dynamic> json) {
    appkey = json['appkey'];
    id = json['id'];
  }
}

class State {
  String amplitude;
  String degreeFb;
  String degreeLr;
  String door;
  String dsdx;
  String hum;
  String louCeng;
  String people;
  String speed;
  String status;
  String temp;

  State(
      {this.amplitude,
      this.degreeFb,
      this.degreeLr,
      this.door,
      this.dsdx,
      this.hum,
      this.louCeng,
      this.people,
      this.speed,
      this.status,
      this.temp});

  State.fromJson(Map<String, dynamic> json) {
    amplitude = json['amplitude'];
    degreeFb = json['degreeFb'];
    degreeLr = json['degreeLr'];
    door = json['door'];
    dsdx = json['dsdx'];
    hum = json['hum'];
    louCeng = json['louCeng'];
    people = json['people'];
    speed = json['speed'];
    status = json['status'];
    temp = json['temp'];
  }
}
